class AreaListResponse {
  List<AreaItemResponse> list;

  AreaListResponse({
    required this.list,
  });

  factory AreaListResponse.fromJson(Map<String, dynamic> json) =>
      AreaListResponse(
        list: (json['data'] as List)
            .map((e) => AreaItemResponse.fromJson(e))
            .toList(),
      );
}

class AreaItemResponse {
  int id;
  String value;
  String text;
  int pid;
  int type;

  AreaItemResponse({
    required this.id,
    required this.value,
    required this.text,
    required this.pid,
    required this.type,
  });

  factory AreaItemResponse.fromJson(Map<String, dynamic> json) {
    return AreaItemResponse(
      id: json['id'] as int,
      value: json['value'] as String,
      text: json['text'] as String,
      pid: json['pid'] as int,
      type: json['type'] as int,
    );
  }

  Map<String, dynamic> toJson() => {
        'id': id,
        'value': value,
        'text': text,
        'pid': pid,
        'type': type,
      };
}
